import cv2
import os
from utils.config import input_image_path,input_image1_path  # 导入输入图片路径

def load_image():
    """加载输入图片"""
    image = cv2.imread(input_image_path)
    if image is None:
        raise FileNotFoundError("无法加载图片，请检查路径是否正确！")
    return image

def load_image1():
    """加载输入图片"""
    image = cv2.imread(input_image1_path)
    if image is None:
        raise FileNotFoundError("无法加载图片，请检查路径是否正确！")
    return image

def show_image(window_name, image):
    """显示图片"""
    cv2.imshow(window_name, image)
    cv2.waitKey(0)
    cv2.destroyAllWindows()

def make_dirs(path):
    """确保目录存在，如果不存在则创建"""
    if not os.path.exists(path):
        os.makedirs(path)
        print(f"创建目录：{path}")

